// Backend.cpp : Defines the entry point for the console application.
//

#include <iostream>
#include "RegEx.h"

using namespace FiniteAutomata;

int main(int argc, char* argv[])
{
	Parser parser;
	NondeterministicFiniteAutomaton nfa;
	DeterministicFiniteAutomaton dfa;

	/*fa1 = parser.CreateNFA("a");
	cout << "NFA:a" << endl;
	fa1.Dump();
	cout << "DFA:a" << endl;
	fa1 = parser.ConvertNFAtoDFA(fa1);
	fa1.Dump();
	cout << endl;

	fa1 = parser.CreateNFA("ab");
	cout << "NFA: ab" << endl;
	fa1.Dump();
	cout << "DFA: ab" << endl;
	fa1 = parser.ConvertNFAtoDFA(fa1);
	fa1.Dump();
	cout << endl;

	fa1 = parser.CreateNFA("a|b");
	cout << "NFA: a|b" << endl;
	fa1.Dump();
	cout << "DFA: a|b" << endl;
	fa1 = parser.ConvertNFAtoDFA(fa1);
	fa1.Dump();
	cout << endl;
	
	fa1 = parser.CreateNFA("a(b|c)d");
	cout << "NFA:a(b|c)d" << endl;
	fa1.Dump();
	cout << "DFA:a(b|c)d" << endl;
	fa1 = parser.ConvertNFAtoDFA(fa1);
	fa1.Dump();
	cout << endl;

	fa1 = parser.CreateNFA("a(b|c)*d");
	cout << "NFA: a(b|c)*d" << endl;
	fa1.Dump();
	fa1 = parser.CreateNFA("a(b|c)*d");
	cout << "DFA: a(b|c)*d" << endl;
	fa1 = parser.ConvertNFAtoDFA(fa1);
	fa1.Dump();
	cout << endl;
*/
	nfa = parser.CreateNFA("(a|b)*abb");
	//dfa = parser.ConvertNFAtoDFA(nfa);
	cout << "NFA: (a|b)*abb" << endl;
	nfa.Dump();
	/*cout << "DFA: (a|b)*abb" << endl;
	dfa.Dump();*/
	cout << endl;

	return 0;
}

